#ifndef SERIAL_H_
#define SERIAL_H_

#define COM1 0x3f8  /* direccion del COM1 */
#define COM2 0x2F8  /* direccion del COM2 */

#define LCR 3		/* offset de los registros */	
#define IER 1
#define THR 0
#define RBR 0
#define MCR 4
#define LSR 5
#define FCR 2

#define PARITY_NONE     0
#define PARITY_ODD      8
#define PARITY_EVEN     24
#define PARITY_MARK     20
#define PARITY_SPACE    28

#define STOP_BIT_ONE    0
#define STOP_BIT_TWO    4

#define WLENGHT_5		0
#define WLENGHT_6     	1
#define WLENGHT_7       2
#define WLENGHT_8       3

void setupUART (int addr, int baud, unsigned char cant_bits, 
					unsigned char paritdad, unsigned char stop_bit);
void writeToUART (int addr, unsigned char c);
void writeStrToUART (int addr, const char * str);
int readFromUART (int addr);

#endif /*SERIAL_H_*/
